<!DOCTYPE HTML>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,aItemress=no">
		<title>支付成功</title>
		<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
		<link rel="stylesheet" type="text/css" href="../../css/app.css" />
		<style type="text/css">
			body {
				background-color: #fff;
			}
			.content {
				width: 8rem;
				height: 8rem;
				padding-top: 6.55rem;
				margin-top: 3.15rem;
				margin-bottom: 2.05rem;
				display: inline-block;
			}

			/* img {
				display: inline-block;
				width: 2.3rem;
			} */

			.tupian img {
				width:8rem;height:8rem;
			}

			.aui-btn-block {
				background   :rgba(0,90,147,1);
				border-radius:0.3rem;
				display      : inline-block;
				width        : 92%;
				height       : 2.3rem;
				line-height  : 2.3rem;
				color        : #FFFFFF;
				font-size    :.8rem;
				font-family  :PingFangSC-Regular;
				font-weight  :400;
				color        :rgba(255,255,255,1);
				position     : absolute;
				left         : 50%;
				transform    : translateX(-50%);
			}

			.btn {
				position: relative;
			}

			.aui-btn:active {
				color: #FFFFFF;
				background-color: inherit !important;
			}
			.flex-content{ display: flex;flex-direction:column; text-align: center;}
			.areaImg img{width:8rem;height:8rem; display: inline-flex;}
			.wrapper{
				 text-align: center;
			}
		</style>
	</head>

	<body>
		<div id="app" v-cloak="">
			<div class="wrapper">
				<div v-if="pay_res=='0'" class="content ming-bg-white" style="background:url(../../image/icon/icon-fail.png)no-repeat;background-size:100% 100%;">
					<!-- <div class="tupian aui-text-center" style="margin-left:.5rem;">
						<img src="../../image/icon/icon-fail.png" />
					</div> -->
					<div class="aui-font-size-16 aui-text-center" style="font-family:PingFangSC-Regular;font-weight:400;color:rgba(34,34,34,1);">
						兑换失败
					</div>
				</div>


				<div v-if="pay_res=='1'" class="content ming-bg-white" style="background:url(../../image/icon/icon-success2.png)no-repeat;background-size:100% 100%;">
					<!-- <div class="tupian aui-text-center" style="margin-left:.5rem;">
						<img src="../../image/icon/icon-fail.png" />
					</div> -->
					<div class="aui-font-size-16 aui-text-center" style="font-family:PingFangSC-Regular;font-weight:400;color:rgba(34,34,34,1);">
						兑换成功
					</div>
				</div>
			</div>


			<!-- <div v-if="pay_res=='0'" class="flex-content">
				<div class="areaImg">
					<img src="../../image/icons/pay_success.png" />

				</div>
				<div class="aui-font-size-16 aui-text-center" style="font-family:PingFangSC-Regular;font-weight:400;color:rgba(34,34,34,1);">
					支付成功
				</div>
			</div> -->
			<div class="btn">
				<div v-show="pay_res=='0'" tapmode onclick="payback()" class="aui-btn aui-btn-block">
					重新支付
				</div>
				<div v-show="pay_res=='1'&&orderinfo.flag!='4'" tapmode onclick="goTodetail()" class="aui-btn aui-btn-block">
					查看订单详情
				</div>
				<div v-show="pay_res=='1'&&orderinfo.flag=='4'" tapmode onclick="open_win('pintuan','../my/order/pintuan.html',false)" class="aui-btn aui-btn-block">
					查看我的拼团
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/vue.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script>
		var vm = new Vue({
			el: '#app',
			data: {
				pay_res: 0,
				order_id: 0,
				orderinfo: {}
			},
		})
		apiready = function() {
			vm.orderinfo = $api.getStorage('orderinfo')
			vm.pay_res = $api.getStorage('pay_res');
			vm.order_id = $api.getStorage('orderinfo').order_id
			send_event('read_msg')
		}

		function goTodetail() {
			console.log(JSON.stringify(vm.orderinfo))
			openWin_score_order_detail(vm.order_id)
			if(api.systemType != 'android') {
				close_win()
			}
			setTimeout(function() {
				close_win()
			}, 1000)
		}

		function payback() {
			// openWin_order_list(0)
			open_win('payment_score', 'payment_score.html')
			if(api.systemType != 'android') {
				close_win()
			}
			setTimeout(function() {
				close_win()
			}, 1000)
		}
	</script>

</html>
